
package com.gitee.jmash.storage.entity;


import java.util.Objects;
import java.util.UUID;
import com.gitee.jmash.common.utils.UUIDUtil;
import com.gitee.jmash.core.orm.jpa.entity.CreateEntity;
import jakarta.json.bind.annotation.JsonbTransient;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;


/**
 * storage 表 .
 *
 * @author <a href="mailto:service@crenjoy.com">crenjoy</a>
 */
@Entity
@Table(name = "storage_organ_info")

public class StorageOrganInfoEntity extends CreateEntity<UUID> {

  private static final long serialVersionUID = 1L;

  /** 存储ID. */
  private UUID storageId = UUID.randomUUID();
  /** 组织ID. */
  private UUID organId;
  /** 组织名称. */
  private String organName;
  /** 服务类型. */
  private String serviceType;
  /** 组织信息存储区. */
  private String storage;
  /** 状态. */
  private Boolean status = true;
  /** 组织编码. */
  private String organCode;
  /** 组织LOGO. */
  private String logoUrl;
  /** 备注. */
  private String remark;

  /**
   * 默认构造函数.
   */
  public StorageOrganInfoEntity() {
    super();
  }

  /** 实体主键. */
  @Transient
  @JsonbTransient
  public UUID getEntityPk() {
    return this.storageId;
  }

  /** 实体主键. */
  public void setEntityPk(UUID pk) {
    this.storageId = pk;
  }
  
  @Transient
  @JsonbTransient
  public String getOrganTenant() {
    return UUIDUtil.uuid32(organId)+"@"+storage;
  }

  /** 存储ID(StorageId). */
  @Id
  @Column(name = "storage_id", nullable = false, columnDefinition = "BINARY(16)")
  public UUID getStorageId() {
    return storageId;
  }

  /** 存储ID(StorageId). */
  public void setStorageId(UUID storageId) {
    this.storageId = storageId;
  }

  /** 组织ID(OrganId). */
  @Column(name = "organ_id", nullable = false, columnDefinition = "BINARY(16)")
  public UUID getOrganId() {
    return organId;
  }

  /** 组织ID(OrganId). */
  public void setOrganId(UUID organId) {
    this.organId = organId;
  }

  /** 组织名称(OrganName). */

  @Column(name = "organ_name", nullable = false)
  public String getOrganName() {
    return organName;
  }

  /** 组织名称(OrganName). */
  public void setOrganName(String organName) {
    this.organName = organName;
  }

  /** 服务类型(ServiceType). */

  @Column(name = "service_type", nullable = false)
  public String getServiceType() {
    return serviceType;
  }

  /** 服务类型(ServiceType). */
  public void setServiceType(String serviceType) {
    this.serviceType = serviceType;
  }

  /** 组织信息存储区(Storage). */

  @Column(name = "storage_", nullable = false)
  public String getStorage() {
    return storage;
  }

  /** 组织信息存储区(Storage). */
  public void setStorage(String storage) {
    this.storage = storage;
  }

  /** 状态(Status). */

  @Column(name = "status_", nullable = false)
  public Boolean getStatus() {
    return status;
  }

  /** 状态(Status). */
  public void setStatus(Boolean status) {
    this.status = status;
  }
 
  @Column(name = "organ_code")
  public String getOrganCode() {
    return organCode;
  }

  public void setOrganCode(String organCode) {
    this.organCode = organCode;
  }

  /** 组织LOGO. */
  @Column(name = "logo_url")
  public String getLogoUrl() {
    return logoUrl;
  }

  /** 组织LOGO. */
  public void setLogoUrl(String logoUrl) {
    this.logoUrl = logoUrl;
  }
  @Column(name = "remark_")
  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  @Override
  public int hashCode() {
    return Objects.hash(storageId);
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }

    StorageOrganInfoEntity other = (StorageOrganInfoEntity) obj;

    return Objects.equals(storageId, other.storageId);
  }



}
